package com.xxx.reggie.mapper;

import com.xxx.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorMapper {

    //批量插入多条口味数据
    Integer saveBatch(@Param("dishFlavors") List<DishFlavor> dishFlavors);

    @Delete("delete from dish_flavor where dish_id=#{dishId}")
    void deleteByDishId(Long id);

    //根据菜品id查询口味列表
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> findAllByDishId(Long dishId);
}
